const ipcRender = (window as any).sendToMain;

export enum TypeKey {
    window = 'window',
    print = 'print'
}

export default function useIpcSend(type: TypeKey) {
    return (message: string, args: unknown = false) => {
        if (type === TypeKey.window) {
            return ipcRender.windowOperate(message);
        } else if (type === TypeKey.print) {
            return ipcRender.printAction(message, args);
        }
    };
}
